<?php

require_once('resources/class/private/webos.php');

$webos = new webosClass();

$webos_menu = $webos -> get_plugin_menu();

while ($dr = mysql_fetch_array($webos_menu)) {
	
	if ($dr['pmParentID'] == 0) {
		
		if (!empty($menu)) {
			
			$menu .= '</add>';
		
			if ($group != $dr['pmGroup']) {
				
				$menu .= '<add></add>';
				
			}
			
		}
		
		$group = $dr['pmGroup'];
		
		$menu .= '<add menutype="' . $dr['pmType'] . '" key="' . $dr['webosPluginMenuID'] . '" name="' . $dr['pmName'] . '">';
		
	} else {
	
		$menu .= '<add menutype="' . $dr['pmType'] . '" key="' . $dr['webosPluginMenuID'] . '" name="' . $dr['pmName'] . '"></add>';
	
	}
	
}

$menu .= '</add>';

header("Content-type: text/xml");

?>
<xmlData>

	<PluginMenu>

		<?php echo $menu;?>

	</PluginMenu>

</xmlData>